package com.mlnx.work.enums;

import com.mlnx.common.enums.BaseCodeEnum;

/**
 * @Author: Akrio
 * @Date: 2021-02-03 16:51
 */
public enum ProjectTypeEnum implements BaseCodeEnum<Integer> {

    NOSET(0,""),PROJECT(1, "项目"), SUBPROJECT(2, "子项目"),SUBSYSTEM(3, "子系统"), ALONE(4, "单机"), TASK(5, "任务"),SUBTASK(6,"子任务");

    private Integer code;

    private String name;

    ProjectTypeEnum(Integer code, String status) {
        this.code = code;
        this.name = status;
    }

    @Override
    public Integer getValue() {
        return code;
    }


    public String getName() {
        return name;
    }


    public static ProjectTypeEnum valueOf(int code) {
        for (ProjectTypeEnum pojectTypeEnum : ProjectTypeEnum.values()) {
            if (pojectTypeEnum.code == code)
                return pojectTypeEnum;
        }
        return null;
    }

    public String getName(String str) {
        for (ProjectTypeEnum pojectTypeEnum : ProjectTypeEnum.values()) {
            if (str.equals(pojectTypeEnum.name))
                return pojectTypeEnum.name;
        }
        return null;
    }
    public static ProjectTypeEnum getCode(String str){
        for (ProjectTypeEnum pojectTypeEnum : ProjectTypeEnum.values()) {
            if (str.equals(pojectTypeEnum.name))
                return pojectTypeEnum;
        }
        return null;
    }

}
